Fix desired size space allocation not respecting minimum sizes correctly#120913
Open
StarryWorm wants to merge 1 commit into
Open
Fix desired size space allocation not respecting minimum sizes correctly#120913StarryWorm wants to merge 1 commit into
StarryWorm wants to merge 1 commit into
Conversation
YeldhamDev
approved these changes
Jul 3, 2026
YeldhamDev
left a comment
Member
There was a problem hiding this comment.
Fixes the issue. And indeed, GUI tests for sizing would help a lot in minimizing those regressions.
KoBeWi
approved these changes
Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem(s) does this PR solve?
In that PR, I made
BoxContainerandGridContainer(andFlowContainer, but that one isn't bugged) allocate space to children whose desired sizes were greater than their minimum sizes.As described in the PR, the flow would go:
The problem is, in both cases, the "remaining space" computed for step 3, which I used for step 2, also includes the space occupied by the minimum size of the children who have the
SIZE_EXPANDflag. This is done such that their final sizes are computed irrespective of their minimum sizes, and only take into account the stretch ratios.However, using that in step 2 resulted in the children in step 2 overallocating, using the minimum size of the expanding children as free space to stretch into. This is completely erroneous and results in the step 2 children taking up more space than is available.
The images below use

HBoxContainer, the project has both, but they look the same, so I only put images for one.Before:
After PR:

Project:
respect-desired-sizes-mrp.zip
Additional information
The project additionally contains the previous tests from #120640 to ensure no regressions against that PR.
This bug slipped through because of a lack of test coverage for the new system, which I should have added earlier. I will work to expand test coverage for these containers so that this kind of oversight does not happen again.